﻿/*
 * @Autor: PK
 * @Date: 2022/01/03 10:40:SS
 */

using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using PropertyChanged;
using ShkSimulation.desktop.Annotations;

namespace ShkSimulation.desktop.setting.tools {

	[AddINotifyPropertyChangedInterface]
	public record RunConfig: AutoSaveConfig {

		public bool 真实时间 { get; set; }
		public TimeSpan 仿真时长 { get; set; }
		public TimeSpan 观察间隔 { get; set; }
		public DateTime 仿真开始时刻 { get; set; }

		public bool IsSetValid() {
			return 仿真时长 >= TimeSpan.Zero &&
			       观察间隔 > TimeSpan.Zero;
		}

		public event PropertyChangedEventHandler PropertyChanged;

		[NotifyPropertyChangedInvocator]
		protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) {
			PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
		}

	}

}